/*
 * @Author: szx
 * @Date: 2022-01-30 11:20:16
 * @LastEditTime: 2022-01-30 11:28:54
 * @Description:
 * @FilePath: \leetcode\800-899\884\884.js
 */
/**
 * @param {string} s1
 * @param {string} s2
 * @return {string[]}
 */
var uncommonFromSentences = function (s1, s2) {
    const map = new Map();
    const arr1 = s1.split(' ');
    const arr2 = s2.split(' ');
    for (let i = 0; i < arr1.length; i++) {
        map.set(arr1[i], (map.get(arr1[i]) || 0) + 1);
    }
    for (let i = 0; i < arr2.length; i++) {
        map.set(arr2[i], (map.get(arr2[i]) || 0) + 1);
    }
    const res = [];
    for (let [key, val] of map.entries()) {
        if (val == 1) res.push(key);
    }
    return res;
};
